package com.xiaoye.demo.test;

/**
 * @Description :
 * @Author : ChenYao
 * @Version : 1.0
 * @Create : Date Time: 2018/8/26 16:26
 * @Update : Date Time: 2018/8/26 16:26
 * @see :
 */
public class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("run begin");
        try {
            Thread.sleep(2000);
            System.out.println("run end");
        } catch (InterruptedException e) {
            System.out.println("在沉睡: " + this.isInterrupted());
            e.printStackTrace();
        }

    }
}

class Run {
    public static void main(String[] args) throws InterruptedException {
        MyThread myThread = new MyThread();
        myThread.start();
        Thread.sleep(200);
        myThread.interrupt();
    }

}
